#ifndef APP_SCENE_HPP_
#define APP_SCENE_HPP_

#include <vector>
#include <device/aerProgram.hpp>
#include <misc/aerShape.hpp>

#include "Data.hpp"



///
/// Handles elements in the scene
///
class Scene
{
  public:
    enum Target
    {
      OPAQUE       = 1 << 0,
      DECALS       = 1 << 1,
      TRANSPARENT  = 1 << 2
    };
      
    struct Light
    {
      aer::Vector3 position;
      aer::Vector3 color;
      aer::Vector3 params; // R:radius, G:falloff, B:cutoff (spotlight only)
    };
  
  public:
    struct Cuboid
    {
      aer::Program program;
      aer::Cube mesh;
    } cubes;

    std::vector<Light> lights; 
  
  
  public:
    void init();
    void update();
    void render(int target, Data& data);
  
  private:
    void renderOpaque(Data& data);
    void renderDecals(Data& data);
    void renderTransparent(Data& data);
};

#endif //APP_SCENE_HPP_
